<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		
		<p id="p1"></p>
		<input type="button" id="btn" value="点击"/>
		<script type="text/javascript">
			/*var jsondata = '{"staff":[{"name":"王珊","age":18},{"name":"小红","age":19},{"name":"小明","age":20}]}';
			var jsonobj = eval('('+jsondata+')');
			alert(jsonobj.staff[0].name);//说明解析成功*/
			
			//var jsondata = '{"staff":[{"name":"王珊","age":18},{"name":"小红","age":19},{"name":"小明","age":20}]}';
			//var jsonobj = JSON.parse(jsondata);
			//alert(jsonobj.staff[0].name);
			var oP = document.getElementById("p1");
			var oBtn = document.getElementById("btn");
			oBtn.onclick = function(){
				var request = new XMLHttpRequest();
				
				request.open("GET","hello.json?name="+obj.staff[0].age);
				request.send();
				/*request.onreadystatechange = function(){
					if(request.readyState == 4 &&request.status == 200){
						
					}
				}*/
			}
		</script>
	</body>
</html>
